package com.ktgj.other.service.impl;

import java.util.List;

import com.ktgj.other.domain.EtOrder;
import com.ktgj.other.mapper.EtOrderMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ktgj.other.mapper.EtOrderitemMapper;
import com.ktgj.other.domain.EtOrderitem;
import com.ktgj.other.service.IEtOrderitemService;

/**
 * 【请填写功能名称】Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-07-22
 */
@Service
public class EtOrderitemServiceImpl implements IEtOrderitemService 
{
    @Autowired
    private EtOrderitemMapper etOrderitemMapper;
    @Autowired
    private EtOrderMapper etOrderMapper;

    /**
     * 查询【请填写功能名称】
     * 
     * @param orderitemid 【请填写功能名称】ID
     * @return 【请填写功能名称】
     */
    @Override
    public EtOrderitem selectEtOrderitemById(Long orderitemid)
    {
        return etOrderitemMapper.selectEtOrderitemById(orderitemid);
    }

    /**
     * 查询【请填写功能名称】列表
     * 
     * @param etOrderitem 【请填写功能名称】
     * @return 【请填写功能名称】
     */
    @Override
    public List<EtOrderitem> selectEtOrderitemList(EtOrderitem etOrderitem)
    {
        return etOrderitemMapper.selectEtOrderitemList(etOrderitem);
    }

    /**
     * 新增【请填写功能名称】
     * 
     * @param etOrderitem 【请填写功能名称】
     * @return 结果
     */
    @Override
    public int insertEtOrderitem(EtOrderitem etOrderitem)
    {
        return etOrderitemMapper.insertEtOrderitem(etOrderitem);
    }

    /**
     * 修改【请填写功能名称】
     * 
     * @param etOrderitem 【请填写功能名称】
     * @return 结果
     */
    @Override
    public int updateEtOrderitem(EtOrderitem etOrderitem)
    {
        return etOrderitemMapper.updateEtOrderitem(etOrderitem);
    }

    /**
     * 批量删除【请填写功能名称】
     * 
     * @param orderitemids 需要删除的【请填写功能名称】ID
     * @return 结果
     */
    @Override
    public int deleteEtOrderitemByIds(Long[] orderitemids)
    {
        return etOrderitemMapper.deleteEtOrderitemByIds(orderitemids);
    }

    /**
     * 删除【请填写功能名称】信息
     * 
     * @param orderitemid 【请填写功能名称】ID
     * @return 结果
     */
    @Override
    public int deleteEtOrderitemById(Long orderitemid)
    {
        return etOrderitemMapper.deleteEtOrderitemById(orderitemid);
    }

    /**
     * 旅客列表
     * */
    @Override
    public List<EtOrderitem> travelerList(Long id) {
        EtOrder etOrder = etOrderMapper.selectEtOrderById(id);
        if (etOrder != null){
            List<EtOrderitem> traveler = etOrderitemMapper.traveler(etOrder.getOrderid());
            return traveler;
        }
        return null;
    }
}
